﻿    // validate signup form on keyup and submit
   myForm = $("#formID").validate({
        submitHandler: function(form) {
            $("#notify").hide();
            nextStep();
            return false;
        },
        success: function(label) {
            label.addClass("validLabel").html("<img src=\"images/ok.gif\" />");
            //$(".prova").html("<img src=\"images/ok.gif\" />");
        },
        invalidHandler: function(form, validator) {
            var errors = validator.numberOfInvalids();
            if (errors) {
                var message = errors == 1 ? 'Un campo contiene degli errori' : errors + ' campi non sono validi';
                $("#notify").html(message);
                $("#notify").show();
            }
        }
    });
    $.validator.addMethod(
    "italianDate",
    function(value, element) {
        return value.match(/^(((((0[1-9])|(1\d)|(2[0-8]))[-\/]((0[1-9])|(1[0-2])))|((31[-\/]((0[13578])|(1[02])))|((29|30)[-\/]((0[1,3-9])|(1[0-2])))))[-\/](((19|20)[0-9][0-9]))|(29[-\/]02[-\/]20(([02468][048])|([13579][26]))))$/);
    }, "Usa il formato gg/mm/aaaa"
);